package web.base;

import javax.servlet.http.HttpServletRequest;

// 会话级信息存入redis中，多个web server共享
public class RedisHttpSession {

	// 可以考虑使用userid来追踪会话
	private static final String SESSION_KEY = "mysessionid";
	// 20分钟
	private static final int SESSION_TIMEOUT = 20*60; 
	
	public <T> T getSessionAttr(HttpServletRequest request, String key, Class<?> clazz){
		
		return null;
	}
	
	public void setSessionAttr(HttpServletRequest request, String key, Object value){
        
	}
	
	private String getSessionKey(HttpServletRequest request){
		long mysessionid = Long.parseLong(request.getParameter(SESSION_KEY));
		
		return SESSION_KEY + "_" + mysessionid;
	}
}
